package com.iflytek.jcy.supervise.job.component.tlog;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import cn.hutool.core.util.IdUtil;
import com.yomahub.tlog.id.TLogIdGenerator;

/**
 * @author <a href=mailto:ktyi@iflytek.com>伊开堂</a>
 * @date 2022/4/1
 */
public class MyTLogIdGenerator extends TLogIdGenerator {

    public static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");

    @Override
    public String generateTraceId() {
        return LocalDateTime.now().format(FORMATTER) + IdUtil.nanoId(10);
    }
}
